<template>
  <div>
    <van-tabbar v-model="active" route v-if="$route.meta.isYes">
      <van-tabbar-item
        :to="item.path"
        :icon="item.icon"
        v-for="item in navList"
        :key="item.id"
        >{{ item.content }}</van-tabbar-item
      >
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
      navList: [
        {
          id: 1,
          icon: "home-o",
          content: "首页",
          path: "/home"
        },
        {
          id: 2,
          icon: "search",
          content: "分类",
          path: "/type"
        },
        {
          id: 3,
          icon: "friends-o",
          content: "购物车",
          path: "/cart"
        },
        {
          id: 4,
          icon: "setting-o",
          content: "我的",
          path: "/mine"
        }
      ]
    };
  },

  components: {},

  methods: {},
  created() {},
  watch: {
    $route: {
      deep: true,
      handler(route) {
        console.log(route);
      }
    }
  }
};
</script>

<style scoped>
</style>